package com.whut.controller;

import com.whut.model.Greenprojectinfo;
import com.whut.service.GreenProjectService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/greenProject")
public class GreenProjectController {
    @Resource
    private GreenProjectService greenProjectService;
    
    /*
     * @author: wxd
     * @Description: 获取绿化工程所有信息
     * @date: 2020/9/22 16:07
     * @param: null
     */
    @ResponseBody
    @PostMapping("/getGreenProjectInfo")
    public Object getGreenProjectInfo(){return greenProjectService.getGreenProjectInfo();}

    /*
     * @author: wxd
     * @Description: 插入一条绿化工程信息
     * @date: 2020/9/22 16:20
     * @param: [values]
     */
    @ResponseBody
    @PostMapping("/addGreenProjectInfo")
    public String addGreenProjectInfo(@RequestBody Greenprojectinfo values){return greenProjectService.addGreenProjectInfo(values);}

    /*
     * @author: wxd
     * @Description: 删除一条绿化工程信息
     * @date: 2020/9/22 16:26
     * @param: [mKey]
     */
    @ResponseBody
    @PostMapping("/deleteGreenProjectInfo")
    public String deleteGreenProjectInfo(int mKey){return greenProjectService.deleteGreenProjectInfo(mKey);}

    /*
     * @author: wxd
     * @Description: 修改一条绿化工程信息
     * @date: 2020/9/22 16:27
     * @param: [values]
     */
    @ResponseBody
    @PostMapping("/modifyGreenProjectInfo")
    public String modifyGreenProjectInfo(@RequestBody Greenprojectinfo values){return greenProjectService.modifyGreenProjectInfo(values);}

    /*
     * @author: wxd
     * @Description: 根据项目名称搜索绿化工程信息
     * @date: 2020/9/22 16:41
     * @param: [project_name]
     */
    @ResponseBody
    @PostMapping("/searchGreenProjectInfoByProject_Name")
    public Object searchGreenProjectInfo(String project_name){return greenProjectService.searchGreenProjectInfoByProject_Name(project_name);}

}
